package demo.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 操作日志表
 * </p>
 *
 * @author zhonghao
 * @since 2021-04-12
 */
@Data
@ToString
@TableName("demo_system_logs")
@ApiModel(value = "OperationLog对象", description = "操作日志表")
public class SystemLog implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    @ApiModelProperty(value = "操作模块")
    private String title;

    @ApiModelProperty(value = "业务类型 (0其它 1新增 2修改 3删除)")
    private Integer businessType;

    @ApiModelProperty(value = "请求方法")
    private String businessMethod;

    @ApiModelProperty(value = "请求方式 ")
    private String requestMethod;

    @ApiModelProperty(value = "操作类别 (0其它 1后台用户 2手机端用户)")
    private Integer operationType;

    @ApiModelProperty(value = "操作人员")
    private String operatorName;

    @ApiModelProperty(value = "部门名称")
    private String departmentName;

    @ApiModelProperty(value = "请求url")
    private String requestUrl;

    @ApiModelProperty(value = "操作地址")
    private String operationIp;

    @ApiModelProperty(value = "操作地点")
    private String operationLocation;

    @ApiModelProperty(value = "请求参数")
    private String requestParameters;

    @ApiModelProperty(value = "返回参数")
    private String resultParameter;

    @ApiModelProperty(value = "错误消息")
    private String errorMessage;

    @ApiModelProperty(value = "操作状态 (0正常 1异常)")
    private Integer operationStatus;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    @ApiModelProperty("创建时间")
    @ExcelIgnore
    private Date createdTime;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    @ApiModelProperty("更新时间")
    @ExcelIgnore
    private Date updatedTime;

    @ApiModelProperty("更新者")
    @ExcelIgnore
    private Long updatedUserId;

    @ApiModelProperty("创建者")
    @ExcelIgnore
    private Long createdUserId;

    @ApiModelProperty("数据状态")
    @ExcelIgnore
    private String status;
}
